/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.deployment.geoRef;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author roniere
 */
public class GeoRefUtil {

    public void getGeoRefHtml() {
        try {
            URL url = new URL("http://legislacao.pi.gov.br/scan/pages/jsp/scan/consultaDeAtoNormativo.jsp?idAtoNormativo=3908");
            URLConnection conn = url.openConnection();

            InputStream is = url.openStream();
            InputStreamReader isr = new InputStreamReader(is);
            BufferedReader br = new BufferedReader(isr);

            StringBuffer linha = new StringBuffer();
            linha.append(br.readLine());

            while (linha != null) {
                linha.append(br.readLine());
            }
            System.err.println(linha);

        } catch (IOException ex) {
            Logger.getLogger(GeoRefUtil.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
